package com.example.perplonews.a_a_mvp.model.models

import BaseModel
import Tokencontract
import com.example.perplonews.a_b_entity.BaseEntity
import com.example.perplonews.a_b_entity.ToKenEntity
import com.example.perplonews.a_b_utils.LjlUtils
import com.example.perplonews.a_c_network.Api
import com.example.perplonews.a_c_network.HttpFactory
import com.example.perplonews.a_c_network.HttpType
import io.reactivex.Observable
import io.reactivex.functions.Function


class TokenModel :BaseModel(),Tokencontract.Token_MyModel{
    override fun requestToken(map: Map<String, Any>): Observable<BaseEntity> {
        var requestToken = HttpFactory.instance
            .factory(HttpType.TOKENSIGNTYPE)
            ?.getRetrofit()?.create(Api::class.java)
            ?.requestToken(createBody(map))

        var map1 = requestToken?.map(object : Function<ToKenEntity?, BaseEntity> {
            override fun apply(t: ToKenEntity): BaseEntity {

                return t
            }

        })

        return map1!!
    }


}